#pragma once
#include <Arduino.h>

class MQ2Sensor {
public:
    MQ2Sensor(int aoPin, int doPin);
    void begin();
    void update();
    float getConcentration() const;
    bool isAlert() const;
    bool isPreheated() const;
    
private:
    int _aoPin;
    int _doPin;
    float _concentration;
    bool _alert;
    bool _preheated;
    unsigned long _startTime;
    const unsigned long PREHEAT_TIME = 30000; // 30秒预热时间
};
